import { ref, onMounted } from 'vue';

import { get_cate_list } from '@/api/index'

let activeIndex = ref(1)

let cate_list = ref([])

function changeCateIndex(index) {

    activeIndex.value = index

}
export default function () {
    onMounted(function () {
        get_cate_list().then(res => {

            // console.log(res)
            if (res.code === 0) {
                cate_list.value = res.data
            }
        })
    })

    return {
        cate_list,
        activeIndex,
        changeCateIndex
    }


}